package com.cloudbroker.bcs.platform.ltb.middle.service.impl;

import com.cloudbroker.bcs.platform.ltb.bizapi.service.admin.vo.AdminUserIdList;
import com.cloudbroker.bcs.platform.ltb.common.config.ConfigValues;
import com.cloudbroker.bcs.platform.ltb.middle.dao.LeaderDAO;
import com.cloudbroker.bcs.platform.ltb.middle.entity.Leader;
import com.cloudbroker.bcs.platform.ltb.middle.entityview.LeaderListView;
import com.cloudbroker.bcs.platform.ltb.middle.service.LeaderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by zsh on 16/7/7.
 */

@Service
public class LeaderServiceImpl implements LeaderService {

    @Resource
    private LeaderDAO leaderDAO;

    @Override
    public void addLeader(Leader leader) {
        leader.setMycat_flag(ConfigValues.getMycatFlag());
        leaderDAO.addLeader(leader);
    }

    @Override
    public Leader getLeader(Leader leader) {
        return leaderDAO.getLeader(leader);
    }

    @Override
    public void updateLeaderHeadpic(Leader leader) {
        leaderDAO.updateLeaderHeadpic(leader);
    }

    @Override
    public void updateLeaderAliasName(Leader leader) {
        leaderDAO.updateLeaderAliasName(leader);
    }

    @Override
    public Long getLeaderID(Leader leader) {
        return leaderDAO.getLeaderID(leader);
    }

    @Override
    public List<LeaderListView> queryLeaderList(List<AdminUserIdList> list) {
        return leaderDAO.queryLeaderList(list);
    }

    @Override
    public void updateLeaderJobState(Leader leader) {
        leaderDAO.updateLeaderJobState(leader);
    }
}
